﻿/**************************************************************************
创建时间:	2020/5/16 23:41:53    
作	  者:	张存
邮 	  箱:	zhangcunliang@126.com

Copyright (c) zhcun.cn

描	述：
记	录：
***************************************************************************/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using ZhCun.Win.Controls;

namespace ZhCun.Win.ExtendGridCombox
{
    public partial class FrmGridComboxColumnEdit : FrmBaseEdit
    {
        public FrmGridComboxColumnEdit()
        {
            InitializeComponent();
            Init();
        }

        public int DgvRowCount { set; get; }

        void Init()
        {
            coBoxColumnType.Items.Clear();
            var colTypes = Enum.GetNames(typeof(DgvColumnType));
            coBoxColumnType.Items.AddRange(colTypes);
            coBoxColumnType.SelectedIndex = 0;

            //对齐方式
            coBoxAlignment.Items.Clear();
            var alTypes = Enum.GetNames(typeof(DataGridViewContentAlignment));
            coBoxAlignment.Items.AddRange(alTypes);
            coBoxAlignment.SelectedIndex = 0;

            coBoxColAutoSizeMode.Items.Clear();
            var autoMode = Enum.GetNames(typeof(DataGridViewAutoSizeColumnMode));
            coBoxColAutoSizeMode.Items.AddRange(autoMode);
            coBoxColAutoSizeMode.SelectedIndex = 0;
        }

        private void FrmGridComboxColumnEdit_Load(object sender, EventArgs e)
        {
            if (EditArg.ClearId)
            {
                txtColumnIndex.Value = DgvRowCount + 1;
            }
        }
    }
}
